<template>
  <view>
    <view class="search">
      <text class="iconfont iconsearch"></text>
      <input type="text" placeholder="小清新" />
    </view>
    <!-- 历史搜索 -->
    <view class="search_hd">历史搜索</view>
    <view class="search_wrap">
      <view class="search_words" v-for="(item, i) in history" :key="i">
        <text>{{ item }}</text>
      </view>
    </view>
    <!-- 关键词 -->
    <view class="search_hd">热门搜索</view>
    <view class="search_wrap">
      <view class="search_words" v-for="(item, i) in words" :key="i">
        <text>{{ item }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      words: ["小清新", "自然风景", "二次元", "护眼", "鬼灭之刃", "摄影"],
      history: ["Lisa", "烘焙", "王者荣耀", "哆啦A梦"],
    };
  },
};
</script>

<style lang="scss">
.search {
  display: flex;
  align-items: center;
  height: 80rpx;
  margin: 20rpx;
  margin-bottom: 40rpx;
  padding: 0 20rpx;
  height: 80rpx;
  // min-height: 40rpx;
  border: 1rpx solid $color;
  border-radius: 40rpx;
  .iconfont {
    font-size: 30rpx;
    color: #aaa;
  }
  input {
    margin-left: 10rpx;
    line-height: 80rpx;
  }
}
.search_hd {
  margin: 0 20rpx;
  font-size: 36rpx;
  font-weight: 700;
  color: #111;
}
.search_wrap {
  display: flex;
  flex-wrap: wrap;
  margin: 40rpx 20rpx;
  .search_words {
    margin-right: 20rpx;
    margin-bottom: 20rpx;
    padding: 20rpx;
    line-height: 30rpx;
    background-color: #eee;
    border-radius: 10rpx;
    text-align: center;
  }
}
</style>
